package com.denlaku.longan.repository;

import com.denlaku.longan.dao.PlaceholderDao;
import com.denlaku.longan.vo.Placeholder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class PlaceholderRepository {
    @Autowired
    private PlaceholderDao placeholderDao;

    /**
     * 新增占位符
     * @param placeholder 占位符
     * @return 新增记录数
     */
    public int add(Placeholder placeholder) {
        return placeholderDao.add(placeholder);
    }

    /**
     * 删除占位符
     * @param dataSetId 数据集id
     * @return 删除记录数
     */
    public int delete(Long tenantId, Long dataSetId) {
        return placeholderDao.delete(tenantId, dataSetId);
    }

    /**
     * 查询占位符
     * @param dataSetId 数据集id
     * @return 占位符列表
     */
    public List<Placeholder> list(Long tenantId, Long dataSetId) {
        return placeholderDao.list(tenantId, dataSetId);
    }
}
